package com.cj.sys.web.security;

import java.util.HashMap;

import com.cj.common.web.struts2.BaseActionSupport;

public class TreeAction extends BaseActionSupport {
	private String returnName;
	private String returnIndex;
	private String treeUrl;
	private HashMap<String, String> retureContexts = new HashMap<String, String>();
	
	@Override
	public String execute() throws Exception {
		return getTreeValue();
	}	
	
	public String getTreeValue() {
		resolveReturn();
		return "tree";
	}
	
	private void resolveReturn() {
		String[] returnNames = returnName.split(",");
		String[] returnIndexs = returnIndex.split(",");
		for (int i = 0; i < returnNames.length; i++) {
			retureContexts.put(returnNames[i], returnIndexs[i]);
		}
	}
 	public String getTreeUrl() {
		return treeUrl;
	}

	public void setTreeUrl(String treeUrl) {
		this.treeUrl = treeUrl;
	}


	public HashMap<String, String> getRetureContexts() {
		return retureContexts;
	}

	public void setRetureContexts(HashMap<String, String> retureContexts) {
		this.retureContexts = retureContexts;
	}

	public String getReturnName() {
		return returnName;
	}

	public void setReturnName(String returnName) {
		this.returnName = returnName;
	}

	public String getReturnIndex() {
		return returnIndex;
	}

	public void setReturnIndex(String returnIndex) {
		this.returnIndex = returnIndex;
	}

	
}
